﻿@inherits AntInput

<div class="ant-checkbox-group">
    @if (Items != null && Items.Count > 0)
    {
        var index = 0;
        foreach (var item in Items)
        {
            var id = $"{Id}_{index++}";
            var classWrapper = "ant-checkbox-wrapper ant-checkbox-group-item";
            var className = "ant-checkbox";
            if (Value?.Contains(item.Key) == true)
            {
                classWrapper += " ant-checkbox-wrapper-checked";
                className += " ant-checkbox-checked";
            }
            <label class="@classWrapper">
                <span class="@className">
                    @if (Value?.Contains(item.Key) == true)
                    {
                        <input type="checkbox" id="@id" name="@Id" value="@item.Key" class="ant-checkbox-input" checked>
                    }
                    else
                    {
                        <input type="checkbox" id="@id" name="@Id" value="@item.Key" class="ant-checkbox-input">
                    }
                    <span class="ant-checkbox-inner"></span>
                </span>
                <span>@item.Value</span>
            </label>
        }
    }
</div>